package com.aternity.httpfetch;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import org.apache.commons.lang.StringUtils;

/**
 *
 * @author Daniel Orr
 */
public class CountCommas {

    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("outfile.txt");
        try (
                BufferedReader br = new BufferedReader(fr)) {
            String line;

            int i =0;
            while ((line = br.readLine()) != null) {
                line = line.trim();
                int count = StringUtils.countMatches(line, ",");
                if (count != 4)
                {
                    i++;
                    System.out.println(line);
                }
            }
            System.out.println(i);
        }
    }
}
